# 将当前项目中的源码目录作为子项目编译
add_subdirectory(vendor/SDL3)
# 添加子目录，首先构建glm库
add_subdirectory(vendor/glm)
add_subdirectory(vendor/spdlog)
add_subdirectory(vendor/glad)
add_subdirectory(vendor/soil2)
add_subdirectory(vendor/entt) 
add_subdirectory(vendor/sol3) 

add_library(SCION_UTILITIES STATIC
    SDL_Wrappers.cpp
)

# 设置预编译头文件
target_precompile_headers(SCION_UTILITIES PRIVATE
    ./hzpch.h
)

target_include_directories(SCION_UTILITIES PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/spdlog/include
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/SDL3/include
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/glm/glm  # 添加glm头文件路径
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/glad/include  # 添加glad头文件路径
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/soil2/src/SOIL2
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/sol3/include/sol
    # 添加 Lua 头文件路径
    ${CMAKE_CURRENT_SOURCE_DIR}/vendor/lua53/include
)

# 链接 SDL3（头文件）
target_link_libraries(SCION_UTILITIES 
PRIVATE 
# spdlog::spdlog
spdlog::spdlog_header_only
SDL3::SDL3
glm::glm
GLAD
soil2
EnTT::EnTT
sol2::sol2 
# Lua 库
${CMAKE_CURRENT_SOURCE_DIR}/vendor/lua53/lib/lua53.lib
)

# 明确添加源文件
target_sources(SCION_UTILITIES PRIVATE
    SDL_Wrappers.cpp
    Log.cpp)